/*
 * 〈描述〉
 *
 * @author chenxing
 * @since 版本号
 */

package com.maorioi.failureanalyzer.component;

import com.maorioi.failureanalyzer.other.YamlPropertySourceFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;
import java.util.Map;

/**
 * 〈一句话功能简述〉
 *
 * <p>〈功能详细描述〉
 *
 * @author chenxing
 * @since 版本号
 */
@ConfigurationProperties("developer")
@PropertySource(value="classpath:developer-mobile.yml", factory = YamlPropertySourceFactory.class)
@Component
@Validated
public class DeveloperMobile {

    @NotNull
    private Map<String, String> data;

    public Map<String, String> getData() {
        return data;
    }

    public void setData(Map<String, String> data) {
        this.data = data;
    }

    public String findMobile(String username){
        return data.get(username);
    }
}
